#:import md_icons kivymd.icon_definitions.md_icons


<MDLabel>
    disabled_color: self.theme_cls.disabled_hint_text_color
    # FIXME: Overriding the values of this property greatly affects application
    #  performance. Especially when the application window is resized and a
    #  custom font is used. Performance is especially slow when you are using
    # `PIL` as your text processing provider - os.environ ['KIVY_TEXT'] = 'pil'.
    #  Priority - CRITICAL.
    text_size: self.width, None


<MDIcon>:
    font_style: "Icon"
    text: u"{}".format(md_icons[self.icon]) if self.icon in md_icons else ""
    source: None if self.icon in md_icons else self.icon

    canvas:
        Color:
            rgba: (1, 1, 1, 1) if self.source else (0, 0, 0, 0)
        Rectangle:
            source: self.source if self.source else None
            pos: self.pos
            size: self.size
